#include "global.h"

void rf01_trans(unsigned short wert);
void rf01_init(void);
void rf01_setbandwidth(unsigned char bandwidth);
void rf01_setreceiver(unsigned char gain, unsigned char drssi);
void rf01_setfreq(unsigned short freq);
void rf01_setbaud(unsigned short baud);
void rf01_rxdata(unsigned char *data);
void rf01_startrecive(void);
void rf01_start(void);

#define RF01FREQ(freq)	((freq-430.0)/0.0025)

#define RF_PORT	PORTB
#define RF_DDR	DDRB
#define RF_PIN	PINB

#define SDI		1	// SDI,  -> RF02 PIN 2
#define SCK		2	// SCK,  -> RF02 PIN 3
#define CS		3	// nSEL, -> RF02 PIN 4
#define SDO		0	// SDO,  <- RF02 PIN 1

static unsigned char sdrssi, sgain;
